<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        /* 当用户鼠标输入才变红 */
        /* 达不到效果 */
        /* .inp {
            color: red;
        } */
        /* 伪类可以达到效果 */
        .inp:focus {
            color: red;
        }
    </style>
</head>
<body>
    <input class="inp" type="text" value="hello">
</body>
</html>